/****************************************************************************
 * gecko_debug.h
 * 
 * USB Gecko Debugger helper functions
 ***************************************************************************/
 
#ifndef _GECKO_DEBUG_H_
#define _GECKO_DEBUG_H_

#include <stdio.h>
#include <stdarg.h>

#define OUT		0
#define ERROR	1

/* 
 * call debug() to output debug/error info to 
 * stdout or stderr respectively, which is
 * hopefully redirected to the USB Gecko (set this up)
 *
 * set level to one of the defines above (OUT, ERROR)
 */
inline void debug(int level, const char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	vfprintf( (level == OUT)?stdout:stderr , fmt, ap);
	va_end(ap);
}

/* 
 * Redirect stdout and stderr to the USB Gecko
 */
void USBGeckoOutput();

#endif
